package com.pmgames.store.data
{
	import flash.events.EventDispatcher;
	
	public class RelationItem extends EventDispatcher
	{
		public var id:int;
		public var sourceId:WordItem;
		public var destId:WordItem;
		public var relation:String;
		
		public function RelationItem(id:int = 0, sourceId:WordItem = null, relation:String = null, destId:WordItem = null)
		{
			super();
			if(id != 0)
			{
				this.id = id;
			}
			if(sourceId != null)
			{
				this.sourceId = sourceId;
			}
			else
			{
				this.sourceId = new WordItem();
			}
			if(relation != null)
			{
				this.relation = relation;
			}
			else
			{
				this.relation = new String();
			}
			if(destId != null)
			{
				this.destId = destId;
			}
			else
			{
				this.destId = new WordItem();
			}
		}
		
		public function equal(srcId:int, dstId:int):Boolean
		{
			return sourceId.id == srcId && destId.id == dstId;
		}
		
	}
}